package com.goal.struggle.dao.goal;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.goal.struggle.model.repository.goal.GoalDailyDO;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GoalDailyMapper extends BaseMapper<GoalDailyDO> {

    default List<GoalDailyDO> getGoalDailyByUserId(int userId) {
        return this.selectList(new QueryWrapper<GoalDailyDO>().lambda()
                .eq(GoalDailyDO::getUserId, userId)
                .eq(GoalDailyDO::getDeleted, 0));
    }
}
